<html>
<head>
<title>ScrollWindow example</title>
<link rel="stylesheet" type="text/css" href="default.css" />
<script type="text/javascript" src="../src/main/js/loader.js"></script>
<script type="text/javascript">

	load('core.ui.ScrollWindow');

	function init() {

		scrollArea = new core.ui.ScrollWindow();

		text = '<p>\
A container class which implements automatic horizontal and/or\
 vertical scrolling for a single child component.  The display\
 policy for the scrollbars can be set to:\
 </p><ol>\
 <li>as needed: scrollbars created and shown only when needed by scrollpane\
 </li><li>always: scrollbars created and always shown by the scrollpane\
 </li><li>never: scrollbars never created or shown by the scrollpane\
 </li></ol>\
 <p>\
 The state of the horizontal and vertical scrollbars is represented\
 by two <code>ScrollPaneAdjustable</code> objects (one for each\
 dimension) which implement the <code>Adjustable</code> interface.\
 The API provides methods to access those objects such that the\
 attributes on the Adjustable object (such as unitIncrement, value,\
 etc.) can be manipulated.\
 </p><p>\
\
 Certain adjustable properties (minimum, maximum, blockIncrement,\
 and visibleAmount) are set internally by the scrollpane in accordance\
 with the geometry of the scrollpane and its child and these should\
 not be set by programs using the scrollpane.\
 </p><p>\
 If the scrollbar display policy is defined as "never", then the\
 scrollpane can still be programmatically scrolled using the\
 setScrollPosition() method and the scrollpane will move and clip\
 the child\'s contents appropriately.  This policy is useful if the\
 program needs to create and manage its own adjustable controls.\
 </p><p>\
 The placement of the scrollbars is controlled by platform-specific\
 properties set by the user outside of the program.\
 </p><p>\
 The initial size of this container is set to 100x100, but can\
 be reset using setSize().\
 </p><p>\
 Scrolling with the wheel on a wheel-equipped mouse is enabled by default.\
 This can be disabled using setWheelScrollingEnabled().  Wheel scrolling can\
 be customized by setting the block and unit increment of the horizontal and\
 vertical Adjustables.\
 </p><p>\
 Insets are used to define any space used by scrollbars and any\
 borders created by the scroll pane. getInsets() can be used\
 to get the current value for the insets.  If the value of\
 scrollbarsAlwaysVisible is false, then the value of the insets\
 will change dynamically depending on whether the scrollbars are\
 currently visible or not.\
\
</p><p>'

		scrollArea.setContentWindow(new core.ui.Window(scrollArea));
		scrollArea.setText(text);
		scrollArea.center();
		scrollArea.show();
	}
	
</script>
<style type="text/css">

	.ScrollWindow {
		width: 300px;
		height: 300px;
		background-color: lightblue;
		border: 1px solid blue;
		white-space: nowrap;
	}

</style>
</head>

<body onload="init()">
<a href="javascript:scrollArea.setText('');">Clear text</a> | 
<a href="javascript:scrollArea.setText(text);">Insert text</a> | 
<a href="javascript:scrollArea.setStyle('white-space', 'normal'); scrollArea.setText(text);">Wrap text</a> | 
<a href="javascript:scrollArea.setStyle('white-space', 'nowrap'); scrollArea.setText(text);">Nowrap</a>
</body>
</html>